﻿namespace AzManAPI.AzManClient.Helpers
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.ComponentModel;
    using System.Linq.Expressions;

    public class PropertyHelper
    {
        public static PropertyChangedEventArgs GetFor(Expression<Func<object>> propertyNameLambda)
        {
            MemberExpression member = propertyNameLambda.Body as MemberExpression;
            if (member != null)
            {
                return new PropertyChangedEventArgs(member.Member.Name);
            }
            return new PropertyChangedEventArgs(string.Empty);
        }
    }
}